package com.sport.facilities.booking.system.htmlchecker;

import android.util.Log;

public class MakeBookingResultChecker extends BasicChecker {
	private final String TAG = "MakeBookingResultChecker";

	public boolean getBookingResultfromHtml(String html) throws Exception {
		super.hasError(html);
		Log.d(TAG, "html : " + html);
		boolean b = html.contains("Successful");
		
		boolean p1 = html.contains("maximum daily quota");
		if(p1==true){
			throw new Exception("Sorry! You have exceeded your maximum daily quota!");
		}
		
		Log.d(TAG, "getBookingResultfromHtml : " + b);
		return b;
	}
	/*
	 * Pattern 1 <tr><td width=1%></td><td width=1%><P><FONT
	 * size=3><B></B></FONT></P></td>&nbsp; <td><P><FONT size=3><B>Successful
	 * !</B>
	 * 
	 * 
	 * Pattern 2 01-31 16:30:36.405: D/MakeBookingResultChecker(26715): <tr><td
	 * width=1%></td><td width=1%><P><FONT size=3><B>&nbsp;</B></FONT></P></td>
	 * <td><P><FONT size=3><B>Sorry! You have exceeded your maximum daily quota
	 * </B></FONT></P></td></tr>
	 */
}
